package org.yaac.server.egql.evaluator.function;

import static com.google.common.collect.Sets.newHashSet;

import java.util.Collection;

import org.yaac.server.egql.evaluator.Evaluator;
import org.yaac.server.egql.exception.EGQLE003Exception;
import org.yaac.server.egql.exception.EGQLException;



/**
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public class FunctionUtil {

	/**
	 * @param ops
	 * @param paramSizes
	 * @throws EGQLException
	 */
	public static void ensureParamSize(Collection<Evaluator> ops, Integer ...paramSizes
			) throws EGQLException {		
		if (!newHashSet(paramSizes).contains(ops.size())) {
			throw new EGQLE003Exception();
		}
	}
}
